package charpter12.lynx;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.logging.Logger;

public class Six {
	private static class ExceptionOne extends Exception{
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;
		private static Logger logger = Logger.getLogger("ExceptionOne");
		public ExceptionOne(){
			StringWriter writer = new StringWriter();
			printStackTrace(new PrintWriter(writer));
			logger.severe(writer.toString());
		}
	}
	
	private static class ExceptionTwo extends Exception{
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;
		private static Logger logger = Logger.getLogger("ExceptionTwo");
		public ExceptionTwo(){
			StringWriter writer = new StringWriter();
			printStackTrace(new PrintWriter(writer));
			logger.severe(writer.toString());
		}
	}
	
	public static void main(String[] args) {
		new ExceptionOne();
		new ExceptionTwo();
	}
}
